/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */
package io.renren.modules.sys.controller

import io.renren.modules.sys.entity.SysUserEntity
import org.apache.shiro.SecurityUtils
import org.slf4j.LoggerFactory

/**
 * Controller公共组件
 *
 * @author Mark sunlightcs@gmail.com
 */
abstract class AbstractController {
    protected var logger = LoggerFactory.getLogger(javaClass)
    protected val user: SysUserEntity?
        protected get() = SecurityUtils.getSubject().principal as SysUserEntity

    protected val userId: Long?
        protected get() = user!!.userId
}